package model;

import java.util.ArrayList;
import java.util.List;
import controller.DataBaseInteactor;

/**
 * 
 * @author Brendan Ng
 * @version
 *
 */

public class Reviewer {
	private final String firstName;
	private final String lastName;
	private final String username;
	private final String password;
	
	private final DataBaseInteactor interactor;
	
	/**
	 * Create a reviewer with the given first/last name, username and password.
	 * 
	 * @param theFirstName The author's first name
	 * @param theLastName The author's last name
	 * @param theUsername The author's username
	 * @param thePassword The author's password
	 * @param theInterector The interactor
	 */
	public Reviewer(String theFirstName, String theLastName, String theUsername, String thePassword,
			DataBaseInteactor theInteractor) {
		firstName = theFirstName;
		lastName = theLastName;
		username = theUsername;
		password = thePassword;
		interactor = theInteractor;
	}
	
	/**
	 * Create a reviewer with the given username and password.
	 * The first/last names are initialized to be empty strings.
	 * 
	 * @param theUsername The username
	 * @param thePassword The password
	 * @param theInteractor The interactor
	 */
	public Reviewer(String theUsername, DataBaseInteactor theInteractor) {
		username = theUsername;
		password = "";
		firstName = "";
		lastName = "";
		interactor = theInteractor;
	}
	
	/**
	 * Get the first name.
	 * @return The first name
	 */
	public String getFirstName() {
		return firstName;
	}
	
	/**
	 * Get the last name.
	 * @return The last name
	 */
	public String getLastName() {
		return lastName;
	}
	
	/**
	 * Get the username.
	 * @return The username
	 */
	public String getUsername() {
		return username;
	}
	
	/**
	 * Get the password.
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}
	
	/**
	 * Get the specified manuscript from the given conference.
	 * The author's name must be specified.
	 * 
	 * @param theAuthor The author of the manuscript
	 * @param theConference The conference to look under
	 * @param theTitle The title of the manuscript to look for
	 * @return The manuscript contents
	 */
	public String getManuscriptContents(Author theAuthor, Conference theConference, String theTitle) {
		return interactor.getManuscriptContents(theAuthor, theConference, theTitle);
	}
	
	/**
	 * Submit the specified review for the given conference.
	 * The reviewer's name must be specified.
	 * 
	 * @param theReviewerUN The reviewer
	 * @param theConference The conference
	 * @param theAuthorUN The author's name
	 * @param theManTitle The title of the manuscript
	 * @param theReview The review
	 * @return true if submit was successful and false otherwise
	 */
	/* a review will be an arraylist of 11 strings */
	public boolean submitReview(String theReviewerUN, Conference theConference, String theAuthorUN,
								String theManTitle, ArrayList<String> theReview) {
		return interactor.submitReview(theReviewerUN, theConference, theAuthorUN, theManTitle, theReview);
	}
	
	/**
	 * Get the assigned manuscripts for the given reviewer.
	 * 
	 * @param theReviewer The reviewer
	 * @param theConference The conference to look under
	 * @return A list of assigned manuscript(s)
	 */
	public List<String> getAssignedManuscripts(Reviewer theReviewer, Conference theConference) {
		return interactor.getAssignedPapers(theReviewer, theConference);
	}
}
